package com.quectel.emp.vo.securitypatrol;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author bob
 * @email bob.yu@quectel.com
 * @date 2022/5/24 19:56
 */
@Data
@Schema
public class SecurityPatrolEventReportVo {

    @Schema(description = "点位信息dto")
    private ExecInfo execInfo;

    @Schema(description = "上报记录list")
    List<SpEventReportVo> reportVoList;


    /************ 内部类 start ************/
    @Data
    @Schema
    @AllArgsConstructor
    @NoArgsConstructor
    public static class ExecInfo implements Serializable {

        @Schema(description = "任务点位关系表主键 taskRouteId")
        private Long id;

        @Schema(description = "任务id")
        private Long taskId;

        @Schema(description = "执行状态 状态0异常1正常2跳检")
        private Byte status;

        @Schema(description = "跳检原因字典值 若不是跳检,该字段可不传")
        private Byte skipCheckReasonType;

        @Schema(description = "设备经度")
        private Double lng;

        @Schema(description = "设备纬度")
        private Double lat;

        @Schema(description = "设备地址")
        private String address;

        @Schema(description = "跳检抓拍图片,不是跳检无需传入")
        private String snapshotImg;

        @Schema(description = "跳检事件描述,不是跳检无需传入")
        private String detail;

    }

    /************ 内部类 end ************/

    @Data
    @Schema
    @AllArgsConstructor
    @NoArgsConstructor
    public static class SpEventReportVo implements Serializable {

        @Schema(description = "上报记录的id")
        private Long id;

        @Schema(description = "状态0异常1正常2跳检(subject_id为null)")
        private Byte status;

        @Schema(description = "抓拍图片")
        private String snapshotImg;

        @Schema(description = "事件描述")
        private String detail;

        /**
         * 是否分配工单0否1是
         */
        @Schema(description = "是否分配工单0否1是")
        private Byte assignWorkOrder;

        @Schema(description = "工单处理人id 请调用 empapi/workOrder/getServiceUsers 接口获取")
        private Long assignUserId;

    }

}
